<?php
namespace app\index\controller;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

class Index{
    public function index(){
        return view();
    }
    public function sendMail(){
		$mail = new PHPMailer(true);
		$mail->SMTPDebug = 2;
		$mail->isSMTP();
		$mail->Host = 'smtp.163.com';
		$mail->SMTPAuth = true;
		$mail->Username = '17692327993@163.com';
		$mail->Password = '13393331430ltf';
		$mail->SMTPSecure = 'tls';
		$mail->Port = 25;
		// 收件人
		$mail->setFrom('17692327993@163.com');
		$mail->addAddress('zb1181916652@qq.com');//收件人
		$mail->addReplyTo('17692327993@163.com');
		// 内容
		$mail->isHTML(true);
		$mail->Subject = '1';
		$mail->Body    = '22';
		$mail->AltBody = 'xxxxxx';
		if(!$mail->Send()) {
			return false;
		}else{
			return true;
		}
	} 
}
